package activity;

import edos.prm.artifact.Attribute;
import edos.prm.engine.PRM;
import edos.prm.event.Event;
import edos.prm.task.Task;

/**
 * A {@code StockLevel} is an {@code Event} that is managed by the Balloon
 * process.
 * <p>
 * A {@code StockLevel} event is used to signal the (low) level of balloon
 * stock for some size. The event is raised by the consumer sub-process; the
 * event is observed and treated by the production process.
 */
public final class StockLevel implements Event {

	private int stockLevel;
	private int size;
	private Task task;
	
	/**
	 * Create a {@code StockLevel} evennt for a level of stock, for balloons
	 * of a specified size.
	 * 
	 * @param stockLevel the level of stock to signal.
	 * @param size the size of the balloons for which the event is created
	 */
	public StockLevel(Integer stockLevel, Integer size) {
		this.stockLevel = stockLevel;
		this.size = size;
		task = PRM.getTaskManager().currentTask();
	}
	
	/**
	 * Gives the value of the stock level in the information in this event
	 * 
	 * @return an int value representing the stock level.
	 */
	@Attribute
	public int getStockLevel() {
		return this.stockLevel;
	}
	
	/**
	 * Gives the size of the balloons for which this event signals information.
	 * 
	 * @return the size of the balloons as an int
	 */
	@Attribute
	public int getBalloonSize() {
		return this.size;
	}

	public Task getTask() {
		return task;
	}
}
